/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package View.ClusterizationPanel;

import View.ClusterizationPanel.ClusterizationWindow;
import java.awt.Color;
import java.util.ArrayList;
import java.util.Random;
import javax.swing.JPanel;

/**
 *
 * @author vf
 */
public abstract class OptionsPanel extends JPanel{
    
    public ArrayList<Color> colorList;
    public Random rand;
    public ClusterizationWindow mainWin;
    public boolean firstClusterization;

    public abstract void clusterize(String name);
    public abstract int getNumberOfClusters();
    public abstract boolean getNormalisationValue();
    public abstract String getDistanceValue();
    public abstract String getClusterName(int i);
    public abstract Color getClusterColor(int i);
    public abstract float getAttributeWeight(int i);
    public abstract void closeWin();


    public OptionsPanel(){
        rand = new Random();
        colorList = new ArrayList<Color>();
        colorList.add(Color.BLUE);
        colorList.add(Color.RED);
        colorList.add(Color.GREEN);
        colorList.add(Color.YELLOW);
        colorList.add(Color.CYAN);
        colorList.add(Color.MAGENTA);
        colorList.add(Color.ORANGE);
        colorList.add(Color.PINK);
        firstClusterization = true;
    }

    public void setParent(ClusterizationWindow main){}

    public int getNumberOfClusterizations() {
        return mainWin.getNumberOfClusterizations();
    }

    protected Color nextColor(int i){
        if (i<colorList.size())
            return colorList.get(i);
        else
            return new Color(rand.nextFloat(),rand.nextFloat(),rand.nextFloat());
    }
}
